<template>
  <a-card :bordered="false">

    <!-- table区域-begin -->
    <div>
      <a-col :span="12">
        <a-form-item label="用户名字">
          <a-input v-decorator="" placeholder="123"></a-input>
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item label="用户信息">
          <a-input v-decorator="" placeholder="18256451234"></a-input>
        </a-form-item>
      </a-col>


      <a-col :span="4" style="padding-bottom: 11px">用户就诊患者列表：</a-col>


      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
            <router-link :to="{name:'/patientInfo',params: { record }}">查看详情</router-link>
        </span>

      </a-table>
    </div>

    <patient-modal ref="modalForm" @ok="modalFormOk"></patient-modal>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PatientModal from './PatientModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import Area from '@/components/_util/Area'



export default {
name: "PatientData",
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    PatientModal
  },
  data () {
    return {
      description: 'patient管理页面',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key:'rowIndex',
          width:60,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title:'问诊单名称',
          align:"center",
          dataIndex: 'name'
        },
        {
          title:'问诊医生',
          align:"center",
          dataIndex: 'mobile'
        },
        {
          title:'创建时间',
          align:"center",
          dataIndex: ''
        },
        {
          title: '操作',
          dataIndex: 'action',
          align:"center",
          fixed:"right",
          width:147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: "/patient/patient/list",
        delete: "/patient/patient/delete",
        deleteBatch: "/patient/patient/deleteBatch",
        exportXlsUrl: "/patient/patient/exportXls",
        importExcelUrl: "patient/patient/importExcel",

      },
      dictOptions:{},
      pcaData:''
    }
  },
  created() {
    this.pcaData = new Area()
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    },
  },
  methods: {
    getPcaText(code){
      return this.pcaData.getText(code);
    },
    initDictConfig(){
    }
  }

}
</script>

<style scoped>
@import '~@assets/less/common.less';
</style>